package com.ruoyi.system.service;


import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Result;
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result;
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryV3Result;
import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result;
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.ruoyi.system.domain.bm.BMPayment;
import org.springframework.stereotype.Service;

/**
 * 微信公众号公共service
 *
 **/
public interface BaseWxPayService {


    /**
     * 发起微信统一下单
     * @param paymentId
     * @return
     */
    WxPayUnifiedOrderV3Result.JsapiResult createWxPayUnifiedOrder(Long paymentId);

    /**
     * 申请微信退款
     * @param paymentId
     * @return
     */
    WxPayRefundV3Result applyWxRefund(Long paymentId);

    /**
     * 支付回调
     * @param notifyData
     * @param header
     */
    WxPayNotifyV3Result payNotifyCallback(String notifyData, SignatureHeader header,Integer indexId) throws WxPayException;

    /**
     * 退款回调
     * @param notifyData
     * @param header
     * @return
     * @throws WxPayException
     */
    WxPayRefundNotifyV3Result refundNotifyCallback(String notifyData, SignatureHeader header,Integer indexId) throws WxPayException;
}
